Floating-Point Numbers

KCL provides two distinct internal floating-point formats. One format is short; the other is single and serves also as double and long. The data types single-float , double-float , and long-float are considered to be identical, but short-float is distinct. An expression such as (eql 1.0s0 1.0d0) is false, but (eql 1.0f0 1.0d0) is true. Similarly, (typep 1.0L0 'short-float) is false, but (typep 1.0L0 'single-float) is true. For output purposes all floating-point numbers are assumed to be of short or single format.



The floating-point precisions are:

Format     KCL/AOS     KCL/VAX     KCL/SUN     KCL/UST
------------------------------------------------------ 
Short      24 bits     23 bits     24 bits     24 bits
Single     56 bits     55 bits     53 bits     53 bits
Double     56 bits     55 bits     53bits      53 bits
Long       56 bits     55 bits     53 bits     53 bits

The floating-point exponent sizes are:

Format     KCL/AOS     KCL/VAX     KCL/SUN     KCL/UST
------------------------------------------------------
Short      7 bits      8 bits       8 bits      8 bits
Single     7 bits      8 bits      11 bits     11 bits
Double     7 bits      8 bits      11 bits     11 bits
Long       7 bits      8 bits      11 bits     11 bits

There is no ``minus zero.'' (eql 0.0 -0.0) is true.


Common Lisp constants related to floating-point numbers have the following values in KCL.

    most-positive-short-float
      = - most-negative-short-float
      = 7.237005s75  (KCL/AOS)
        1.701412s38  (KCL/VAX)
        3.402823s38  (KCL/SUN and KCL/UST)

    least-positive-short-float
      = - least-negative-short-float
      = 5.397605s-79  (KCL/AOS)
        2.938736s-39  (KCL/VAX)
        1.401298s-45  (KCL/SUN and KCL/UST)

    most-positive-long-float
      = most-positive-double-float
      = most-positive-single-float
      = - most-negative-long-float
      = - most-negative-double-float
      = - most-negative-single-float
      = 7.237005577332264f75  (KCL/AOS)
        1.701411834604692f38  (KCL/VAX)
        1.797693134862315f308  (KCL/SUN and KCL/UST)

    least-positive-long-float
      = least-positive-double-float
      = least-positive-single-float
      = - least-negative-long-float
      = - least-negative-double-float
      = - least-negative-single-float
      = 5.397605346934027f-79  (KCL/AOS)
        2.938735877055719f-39  (KCL/VAX)
        4.940656458412469f-324  (KCL/SUN and KCL/UST)

    short-float-epsilon
      = 4.468372s-7  (KCL/AOS)
        6.938894s-18  (KCL/VAX)
        2.980232s-8  (KCL/SUN and KCL/UST)

    short-float-negative-epsilon
      = 2.980232s-8  (KCL/AOS)
        6.938894s-18  (KCL/VAX)
        2.980232s-8  (KCL/SUN and KCL/UST)

    long-float-epsilon
      = double-float-epsilon
      = single-float-epsilon
      = 1.110223024625157f-16  (KCL/AOS)
        6.938893903907228f-18  (KCL/VAX)
        5.5511151231257827f-17  (KCL/SUN and KCL/UST)

    long-float-negative-epsilon
      = double-float-negative-epsilon
      = single-float-negative-epsilon
      = 6.938893903907228f-18  (KCL/AOS)
        6.938893903907228f-18  (KCL/VAX)
        5.5511151231257827f-17  (KCL/SUN and KCL/UST)

    pi = 3.141592653589793

See Chapter 12 of the Common Lisp Reference Manual for their meanings.